home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / asm_n_z.zip / NJMOVE.DOC < prev    next >
Text File  |  1989-01-16  |  11KB  |  276 lines

  1.  
  2.  
  3.  
  4. Nifty James' Famous Move Utility
  5. Version 1.00 of 16 January, 1989
  6.  
  7. (C) Copyright 1989 by Mike Blaszczak
  8. All Rights Reserved.
  9.  
  10.  
  11.  
  12.  
  13. REDISTRIBUTING THIS PROGRAM FOR ANY PROFIT WITHOUT THE PRIOR WRITTEN
  14. CONSENT OF THE AUTHOR IS STRICTLY PROHIBITED.  THIS PROGRAM MAY NOT
  15. BE RESOLD IN ANY FORM.  DOING SO IS A CRIME.  THE AUTHOR ASSUMES NO
  16. LIABILITY, DIRECT OR CONSEQUENTIAL, FOR THE USE, MISUSE, OR ABUSE OF
  17. THIS PROGRAM.
  18.  
  19. NJMOVE is NOT free software.  If you purchased NJMOVE from a disk
  20. duplication service, you have paid only for the disk and the service
  21. of copying the program.  If you find that you're using the program,
  22. you MUST REGISTER your copy of the program.
  23.  
  24. The idea behind Shareware software is that it will allow you to try
  25. before you buy.  Commercial software is governed by bougs licensing
  26. agreements.  If you buy something and open the package the disks come
  27. in, you can't recoop the money that you spent on the program, if its
  28. $59 or $5900. 
  29.  
  30. If you're using this Shareware program often and you haven't sent in
  31. a contribution, you're stealing software.
  32.  
  33.  
  34.  
  35. Introduction
  36. ------------
  37.  
  38. Often, when managing hard disk drives or even floppy disk systems, it
  39. is necessary to move a file from one subdirectory to another. 
  40. Unfortunately, DOS provides no command to do this.  You can use COPY
  41. and ERASE to get the job done, but that is very inefficient.  Often,
  42. that method will not work because there is not enough free space on
  43. the disk drive to accomodate two copies of a large file.
  44.  
  45. Bigger computers, like the VAX and like systems running UNIX can use
  46. the same old RENAME command to move a file to another device or
  47. across directories.  However, PC-DOS doesn't have this feature, so
  48. that's why I wrote NJMOVE.
  49.  
  50. Oddly enough, the internal "rename" function that DOS has can not
  51. rename a file across a directory or a device.  The rename commands on
  52. larger systems, like VAX VMS, can easily do this.  When using both a
  53. minicomputer or mainframe, and a PC, it is very easy to become
  54. spoiled by the more powerful rename commands.
  55.  
  56.  
  57. Enter NJMOVE.  This program has the same usage as the RENAME command
  58. of DOS:
  59.  
  60.         NJMOVE <source> <dest> [options]
  61.  
  62. <source> is the source filename, and <dest> is the destination file
  63. name.  Both the <source> and <dest> filenames may contain wildcards.
  64. NJMOVE will handle them in the same way that DOS' own RENAME command
  65. handles them.  The [options] following the command parameters
  66. provide a way to effect the way that NJMOVE handles the files it
  67. processes.
  68.  
  69. NJMOVE is best understood by examining examples of its invocation,
  70. and studying the result of the commands.  Here are a few examples of
  71. the application of NJMOVE:
  72.  
  73.  
  74.         NJMOVE testfile.doc newname.doc                        (1)
  75.  
  76. Since NJMOVE has a similar function to DOS' own RENAME command, you
  77. can use it to rename files without changing the directories.  Example
  78. 1 would simply change the name of TESTFILE.DOC to NEWNAME.DOC.
  79.  
  80.  
  81.         NJMOVE \fromroot.txt \wp5\workfile.txt                 (2)
  82.  
  83. This example moves the file in \FROMROOT.TXT into \WP5\WORKFILE.TXT.
  84. Here, NJMOVE shows it strength over the RENAME command and the COPY
  85. comannd.  With one command, you have moved a file into a
  86. subdirectory.  The COPY command would require an additional RENAME
  87. command, and DOS' RENAME command simply can't do a rename across
  88. directories.
  89.  
  90.  
  91.         NJMOVE E:\MYFILE.* E:\MYDIR                            (3)
  92.  
  93. Here, all the files matching the description MYFILE.* in the root
  94. directory of drive E are moved in to the directory MYDIR.  Again,
  95. this is an example of NJMOVE's file moving abilities, not supported
  96. by an other DOS command.  The program moves the files into MYDIR, and
  97. removes the from the root directory.
  98.  
  99. It is important to note that, in example three, if MYDIR were not a
  100. directory, NJMOVE would have renamed the files to MYDIR.*.  For
  101. example, MYFILE.TXT would have become MYDIR.TXT.  If you mistype the
  102. name of your directory, you will find that you've renamed all of the
  103. files.
  104.  
  105. NJMOVE can also "move" files across a disk drive.  This is useful if
  106. you're moving something off of your hard drive to a floppy to make a
  107. backup, or if you're moving something from one disk to another. 
  108. NJMOVE will decide that the two disk devices aren't equal, and will
  109. copy the file.  In this example,
  110.  
  111.     NJMOVE E:\THIS.* A:\SUBDIR\KUMQUAT                     (4)
  112.  
  113. All of the files in the root directory of drive E, matching the file
  114. specification THIS.* will be moved to the \SUBDIR\ directory of A:,
  115. and will be called KUMQUAT.  The file extensions of each file will
  116. remain the same.  This is just as if you had typed
  117.  
  118.     RENAME E:\THIS.* KUMQUAT.*
  119.     COPY E:\KUMQUAT.* A:\SUBDIR\
  120.     ERASE E:\KUMQUAT.*
  121.  
  122. except you have completed the procedure in one quick step.  It is
  123. important to remember that NJMOVE will move a file in this manner
  124. EVEN IF the file has its write-protect bit set.  The file created by
  125. NJMOVE on the new disk drive, however, will have the same file
  126. attributes as the file that NJMOVE found.
  127.  
  128. While on the subject of file attributes, it is also important to note
  129. that NJMOVE sets the "archive" bit of every file that it renames or
  130. moves.
  131.  
  132.  
  133. That's essentially how NJMOVE works.  Especially given example four,
  134. you should have a pretty good idea how NJMOVE can replace the RENAME
  135. command, and how it can be used to replace the RENAME-COPY-ERASE
  136. sequence.  
  137.  
  138. NJMOVE has one option.  If you put /C anywhere on the command line,
  139. the program will ask you to confirm what you're doing.  If you type
  140. "Y", "1", or "T" in reply to the prompt, you will take the action
  141. indicated.  If you type "N", "0" or "F", you will not take the action
  142. and the program will move to the next case.
  143.  
  144. If you enter <CTRL+Z> or "Q", NJMOVE will return to DOS without
  145. processing any other files.  If you type "A", for "All", NJMOVE will
  146. handle the rest of the files without asking you for your feedback on
  147. it.
  148.  
  149. If you see what NJMOVE is doing, and you decide that you don't like
  150. it, you can get out safely by using <CTRL+C> or <CTRL+BREAK>.  NJMOVE
  151. sensitive to these keys -- interrupting the program in that way
  152. shouldn't ever cause any damage to your files.  You might end up with
  153. files in both places, but I doubt that you will ever find that you've
  154. erased the file completely.
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161. Errors
  162. ------
  163.  
  164. If there is a naming collision, NJMOVE will not move the file and
  165. will stop execution; not other files will be moved, even if a
  166. wildcard was given as the source file specification.  NJMOVE will
  167. print the error message
  168.  
  169.     NJMOVE: File naming collision
  170.  
  171. and return to the DOS prompt.  If you are running in a BAT file, you
  172. will find that NJMOVE has set the ERRORLEVEL to 5.
  173.  
  174. NJMOVE will terminate and print the usage of the program if you
  175. include /HELP on the command line, if you have specified no files at
  176. all, or if you have used a bad or mispelled option.  In this event,
  177. NJMOVE will set the ERRORLEVEL to 1.
  178.  
  179. If NJMOVE can't find any matching files, it will say so with a
  180. message that looks like this:
  181.             
  182.     NJMOVE:    No files matched (Filename)
  183.  
  184. It will quit with ERRORLEVEL set to 2.  If one of the filenames you
  185. gave didn't make sense to NJMOVE, the ERRORLEVEL will be 3.
  186.  
  187. If NJMOVE runs out of space while copying a file, or if the
  188. destination device fails or is write protected or somesuch, the error
  189. message you'll get will name what the problem is, and ERRORLEVEL will
  190. be set to 4.
  191.  
  192. Of course, if NJMOVE completes sucessfully, you'll have no error
  193. messages and ERRORLEVEL will be zero.
  194.  
  195.  
  196.  
  197.  
  198. Problems
  199. --------
  200.  
  201. If you run into a problem with NJMOVE, please do write to me.  A
  202. great deal of work went into hand crafting this assembly langauge
  203. program.  I wish everybody to know that I used Microsoft Development
  204. tools to make the package; Microsoft LINK, The Microsoft Macro
  205. Assembler, and Microsoft's CodeView Debugger.  The program was
  206. developed for Microsoft MS-DOS.  At any one point during the
  207. development process, I was experiencing a problem with at least one
  208. of the above pack